/*	This software is under  GNU GENERAL PUBLIC LICENSE Version 2, June 1991
*	for more information read COPYING.TXT
*	Dimitri Sean Ribeiro - 5118549
*/

#ifndef SHELL_H
#define SHELL_H

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/unistd.h>
#include <sys/wait.h>
#include <string.h>
#include <unistd.h>
#include <argz.h>

#include "parser.h"
#include "comando.h"

#define PROMPT "soiishell"

#define ARQUIVO "jobs.txt"

#ifndef HAVE_PROGRAM_INVOCATION_SHORT_NAME
extern char *program_invocation_short_name;
#endif

/* GNU Standard way to report fatal system failure. */
#define fatal() \
	do { fprintf (stderr, "%s: %s: %d: %s: %s\n", \
		program_invocation_short_name, __FILE__, __LINE__,\
		__PRETTY_FUNCTION__, strerror (errno));} while (0)

typedef struct jobs jobs;
struct jobs{
	int job_id;
	char *job_name;
};

void escre_arquivo(struct jobs *, int);
struct jobs *read_bg_file();

void add_process(command_line_t, int);
void remove_processo(int);
void list_processos();      
        
void get_signal_SIGINT(int);
void get_signal_SIGCONT(int);
void get_signal_SIGTSTP(int);

int main(int, char **);
void got_it(int);

#endif
